package 华为;

import java.util.LinkedList;
import java.util.Scanner;

/*
* 按图找最近的路
* */

public class Main2 {
    boolean[][] visited;
    LinkedList<LinkedList<int[]>> res=new LinkedList<>();
    int len=Integer.MAX_VALUE;
    void backteact(int[][] dt, int x, int y, int[] end, LinkedList<int[]> path){
        int m=dt.length,n=dt[0].length;
        if (x<0||x>=m||y<0||y>=n||dt[x][y]==1||visited[x][y]){
            return;
        }
        if (path.size()>len){
            return;
        }
        if (x==end[0]&&y==end[1]){
            res.add(new LinkedList<>(path));
            len=Math.min(len,path.size());
            return;
        }
        path.add(new int[]{x,y});
        visited[x][y]=true;
        backteact(dt,x,y+1,end,path);
        backteact(dt,x+1,y,end,path);
        backteact(dt,x,y-1,end,path);
        backteact(dt,x-1,y,end,path);
        path.removeLast();
        visited[x][y]=false;
    }
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int m=cin.nextInt(),n=cin.nextInt();
        int[][] dt=new int[m][n];//使用二维数组存地图
        int[] start=new int[2],end=new int[2];
        start[0]=cin.nextInt();
        start[1]=cin.nextInt();
        end[0]=cin.nextInt();
        end[1]=cin.nextInt();
        int num=cin.nextInt();
        for (int i = 0; i < num; i++) {
            int x=cin.nextInt(),y=cin.nextInt();
            dt[x][y]=1;//将高山湖泊标记出来
        }
        Main2 obj=new Main2();
        obj.visited=new boolean[m][n];
        obj.backteact(dt,start[0],start[1],end,new LinkedList<>());
        int pathNum=0;
        for (LinkedList<int[]> l:obj.res) {
            if (l.size()==obj.len){
                pathNum++;
            }
        }
        System.out.println(pathNum+" " +obj.len);
    }
}
